<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title><?php echo ($title); ?></title>
    <link rel="stylesheet" href="/Public/web/css/pintuer.css">
    <link rel="stylesheet" href="/Public/web/css/admin.css">
    <script src="/Public/web/js/jquery.js"></script>
    <script src="/Public/web/js/pintuer.js"></script>
    <script src="/Public/web/js/main.js"></script>
</head>

<body>
<form action="?" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 商家列表</strong></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="<?php echo U('index/info');?>"> 添加商家</a> </li>
        <li>搜索商家：</li>
        <li>
            <input type="text" placeholder="请输入搜索关键字" name="company_name" value="<?php echo ($get['company_name']); ?>" class="input" style="width:250px; line-height:17px;display:inline-block" />
            <input type="submit" value="搜索" class="button border-main icon-search"/>
        </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th>logo图片</th>
        <th>名称</th>
        <th>帐号</th>
        <th>手机号</th>
        <!--<th>套餐</th>-->
        <th width="10%">有效期</th>
        <th>状态</th>
        <th width="310">操作</th>
      </tr>
      <?php if(is_array($list)): foreach($list as $key=>$v): ?><tr>
          <td style="text-align:left; padding-left:20px;"><?php echo ($v['c_id']); ?></td>
          <td width="10%"><img src="/<?php echo ($v['company_logo']); ?>" alt="" width="60" height="60" /></td>
          <td><?php echo ($v['company_name']); ?></td>
          <td><?php echo ($v['account_name']); ?></td>
          <td><?php echo ($v['tel']); ?></td>
          <!--<td><?php echo ($v['package_name']); ?></td>-->
          <td><?php echo (date("Y-m-d H:i",$v['expire_time'])); ?></td>
            <td><span class="sp01" onclick="is_stauts(<?php echo ($v['status']); ?>,this)">
            <?php if($v['status'] == 1): ?><img src="/Public/web/images/yes.png" width="18px;"alt="">
                <?php else: ?>
                <img src="/Public/web/images/no.png" width="18px;"alt=""><?php endif; ?>
          </span></td>
          <td>
              <div class="button-group">
                  <a class="button border-main" href="<?php echo U('index/info',array('id'=>$v['c_id']));?>"><span class="icon-edit"></span> 修改</a>
              </div>
          </td>
        </tr><?php endforeach; endif; ?>
      <tr>
        <td colspan="10"><div class="pagelist"><?php echo ($page); ?></div></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">
//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
		
	}
}

function is_stauts(id,t){
    var url = "<?php echo U('index/is_status');?>";
    $.getJSON(url,{id:id},function (data){
        if(data.result == 'yes'){
            $(t).find('img').attr('src',"/Public/web/images/yes.png");
        }else if(data.result == 'no'){
            $(t).find('img').attr('src',"/Public/web/images/no.png");
        }
    })
}

</script>
</body>
</html>